﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for SessionHelper
/// </summary>
public static class SessionHelper
{
    public static Guid UserID
    {
        get
        {
            if (HttpContext.Current.Session["UserID"] != null)
                return new Guid(HttpContext.Current.Session["UserID"].ToString());
            else
                throw new Exception("UserID Session da Yok!");
        }
        set
        {
            HttpContext.Current.Session["UserID"] = value;
        }
    }

    public static string UserName
    {
        get
        {
            if (HttpContext.Current.Session["UserName"] != null)
                return HttpContext.Current.Session["UserName"].ToString();
            else
                throw new Exception("UserName Session da Yok!");
        }
        set
        {
            HttpContext.Current.Session["UserName"] = value;
        }
    }

    public static string UserSurName
    {
        get
        {
            if (HttpContext.Current.Session["UserSurName"] != null)
                return HttpContext.Current.Session["UserSurName"].ToString();
            else
                throw new Exception("UserSurName Session da Yok!");
        }
        set
        {
            HttpContext.Current.Session["UserSurName"] = value;
        }
    }
}
